using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

using FlatRedBall;
using FlatRedBall.Content.AnimationChain;

using FlatRedBall.Graphics.Animation;
using FlatRedBall.Input;
using FlatRedBall.Math.Geometry;
using FlatRedBall.Content;
using FlatRedBall.Instructions;
using System.Threading;
using System.Reflection;
using FlatRedBall.Gui;
using FlatRedBall.Graphics;
using FlatRedBall.Content.Particle;
using FlatRedBall.Graphics.Particle;
using System.Drawing;
using FlatRedBall.ManagedSpriteGroups;
using FlatRedBall.Math;
using FlatRedBall.Content.Polygon;
using Emptiness.Screens;
using FlatRedBall.Graphics.Model;
using Microsoft.Xna.Framework.Input;
using FlatRedBall.Content.Math.Geometry;
using Emptiness.Scripting;

namespace Emptiness
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class EmptinessGame : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        static BooScriptManager booScriptManager;
        private static ContentManager staticContent;

        public static ContentManager GameContentManager
        {
            get { return staticContent; }
        }

        public static BooScriptManager BooScriptManager
        {
            get { return booScriptManager; }
        }

        public EmptinessGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            staticContent = Content;

        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            /*graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 1024;
            graphics.IsFullScreen = true; */

            FlatRedBallServices.InitializeFlatRedBall(this, this.graphics);

            booScriptManager = new BooScriptManager();

            ScreenManager.Start("Emptiness.Screens.SplashScreen");
            
            //FlatRedBallServices.GraphicsOptions.SetResolution(320, 240);
            // Uncomment the following line and add your Screen's fully qualified name
            // if using Screens in your project.  If not, or if you don't know what it means,
            // just ignore the following line for now.
            // For more information on Screens see the Screens wiki article on FlatRedBall.com.
            //Screens.ScreenManager.Start(typeof(Emptiness.Screens.SplashScreen).FullName);

        }

        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);
            Screens.ScreenManager.Activity();

            base.Update(gameTime);
        }

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            FlatRedBallServices.Draw();

            base.Draw(gameTime);
        }


    }
}
